#include <iostream>
using namespace std;


int find(int *f,int n){
	if(f[n] == n)
		return n;
	f[n] = find(f,f[n]);
	return f[n];
}

int main(){
	int n,m,p;
	cin>>n>>m>>p;
	int f[n];
	for(int i=0;i<n;i++)
		f[i] = i;
	
	
	for(int i=0;i<m;i++){
		int a,b;
		cin>>a>>b;
		a--;b--;
		f[find(f,a)] = find(f,b);
	}
//	for(int i=0;i<n;i++)
//		cout<<f[i]<<endl;
	for(int i=0;i<p;i++){
		int a,b;
		cin>>a>>b;
		a--;b--;
		a = find(f,a);
		b = find(f,b);
		if(a == b)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}

	return 0;
}
